package edu.zjut.hjg.saas.biz.dao;

import java.util.List;

import edu.zjut.hjg.saas.biz.model.Subscribe;
import edu.zjut.hjg.saas.biz.support.AppStatus;
import edu.zjut.hjg.saas.biz.support.Paginated;

/**
 * 订购应用模块关系数据库操作接口
 * 
 * @author hjg
 */
public interface SubscribeDao {
    Integer create(Subscribe subscribe);

    void update(Subscribe subscribe);

    Subscribe load(Integer id);

    Subscribe findByKindergartenId(Integer kindergartenId);

    /**
     * @param status 应用状态
     * @param startKindergartenId 从大于该id的应用开始查询，最小从-1开始，即从等于0的ID开始
     * @param limit startKindergartenId起的limit条限制，为防止条数过多导致占用内存过大
     * @return
     */
    List<Subscribe> listByKindergartenStatus(AppStatus status, int startId, int limit);

    Paginated<Subscribe> listByAppStatus(AppStatus status, int pageSize, int page);
}
